package com.wavehi.error.web.controller;

import com.wavehi.error.exception.CustomerException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author WaveHi
 * @Date 14/11/2021 下午 9:23
 * @Version 1.0
 * @Contact HJBWaveHi@163.com
 * @Description
 */
@Controller
@RequestMapping("/common")
public class CommonController {

    @RequestMapping("/hello")
    @ResponseBody
    public String hello() {
        int i = 1 / 0;
        System.out.println("Hello!");
        return "hello";
    }

    @RequestMapping("/hi")
    @ResponseBody
    public String hi() {
        System.out.println("Wow");
        throw new CustomerException("NO!");
    }
}
